package com.sanq.product.cab.exceptions;


import com.sanq.product.cab.redis.constants.BusCode;

/**
 * version: 定义基本错误信息
 * ---------------------
 *
 * @author sanq.Yan
 * @date 2020/1/26
 */
public enum BusExceptionEnum {
    TOKEN("用户Token不存在或以过期", BusCode.TOKEN_CODE),
    IP("访问被限制-黑名单", BusCode.IP_CODE),
    PARAMS("默认参数出现问题", BusCode.PARAM_CODE),
    AUTH("权限管理异常", BusCode.AUTH_CODE),
    VALIDATE("字段验证未通过", BusCode.VALIDATION_CODE),
    DEFAULT("提交出现异常", BusCode.RESULT_ERROR),
    COPY("Bean出现异常", BusCode.COPY_CODE),
    LIMIT("访问被限制-限流", BusCode.LIMIT_CODE);

    private String msg;
    private Integer code;

    BusExceptionEnum(String msg, Integer code) {
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public Integer getCode() {
        return code;
    }
}
